# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1ClientState do
  @moduledoc """
  Represents the state associated with an API client calling the Devices API. Resource representing ClientState and supports updates from API users

  ## Attributes

  *   `assetTags` (*type:* `list(String.t)`, *default:* `nil`) - The caller can specify asset tags for this resource
  *   `complianceState` (*type:* `String.t`, *default:* `nil`) - The compliance state of the resource as specified by the API client.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the client state data was created.
  *   `customId` (*type:* `String.t`, *default:* `nil`) - This field may be used to store a unique identifier for the API resource within which these CustomAttributes are a field.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - The token that needs to be passed back for concurrency control in updates. Token needs to be passed back in UpdateRequest
  *   `healthScore` (*type:* `String.t`, *default:* `nil`) - The Health score of the resource. The Health score is the callers specification of the condition of the device from a usability point of view. For example, a third-party device management provider may specify a health score based on its compliance with organizational policies.
  *   `keyValuePairs` (*type:* `%{optional(String.t) => GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CustomAttributeValue.t}`, *default:* `nil`) - The map of key-value attributes stored by callers specific to a device. The total serialized length of this map may not exceed 10KB. No limit is placed on the number of attributes in a map.
  *   `lastUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the client state data was last updated.
  *   `managed` (*type:* `String.t`, *default:* `nil`) - The management state of the resource as specified by the API client.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the ClientState in format: `devices/{device}/deviceUsers/{device_user}/clientState/{partner}`, where partner corresponds to the partner storing the data. For partners belonging to the "BeyondCorp Alliance", this is the partner ID specified to you by Google. For all other callers, this is a string of the form: `{customer}-suffix`, where `customer` is your customer ID. The *suffix* is any string the caller specifies. This string will be displayed verbatim in the administration console. This suffix is used in setting up Custom Access Levels in Context-Aware Access. Your organization's customer ID can be obtained from the URL: `GET https://www.googleapis.com/admin/directory/v1/customers/my_customer` The `id` field in the response contains the customer ID starting with the letter 'C'. The customer ID to be used in this API is the string after the letter 'C' (not including 'C')
  *   `ownerType` (*type:* `String.t`, *default:* `nil`) - Output only. The owner of the ClientState
  *   `scoreReason` (*type:* `String.t`, *default:* `nil`) - A descriptive cause of the health score.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :assetTags => list(String.t()) | nil,
          :complianceState => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :customId => String.t() | nil,
          :etag => String.t() | nil,
          :healthScore => String.t() | nil,
          :keyValuePairs =>
            %{
              optional(String.t()) =>
                GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CustomAttributeValue.t()
            }
            | nil,
          :lastUpdateTime => DateTime.t() | nil,
          :managed => String.t() | nil,
          :name => String.t() | nil,
          :ownerType => String.t() | nil,
          :scoreReason => String.t() | nil
        }

  field(:assetTags, type: :list)
  field(:complianceState)
  field(:createTime, as: DateTime)
  field(:customId)
  field(:etag)
  field(:healthScore)

  field(:keyValuePairs,
    as: GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1CustomAttributeValue,
    type: :map
  )

  field(:lastUpdateTime, as: DateTime)
  field(:managed)
  field(:name)
  field(:ownerType)
  field(:scoreReason)
end

defimpl Poison.Decoder,
  for: GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1ClientState do
  def decode(value, options) do
    GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1ClientState.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.CloudIdentity.V1.Model.GoogleAppsCloudidentityDevicesV1ClientState do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
